package two;

import java.util.Scanner;

public class Test {
    private static final String[] chinaNum = {"零", "一", "二", "三", "四", "五", "六", "七", "八", "九"};
    private static final String[] unitArr = {"", "十", "百", "千","万"};
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入一个9位以内的整数：");
        long num = scanner.nextLong();
        String chinese = getChinese(num);
        System.out.println(chinese);
    }

    private static String getChinese(long num) {

        StringBuilder result = new StringBuilder();

        int[] ints = new int[10];
        int i = 1;
        while (num > 0) {
            ints[i-1] = (int) (num%10);
            num /= 10;
            i++;
        }
        System.out.println(i);
        int max = i;
        //if (i > 8) {
        //    result.insert(0, chinaNum[ints[8]]);
        //    result.insert(0, "亿");
        //}
        //if (i > 4) {
        //    for (int j = 8; j > 4; j--) {
        //        result.insert(0, chinaNum[ints[j]]);
        //        result.insert(0, unitArr[j-4]);
        //    }
        //}
        //for (i--;i >= 0; i--) {
        //    System.out.println(ints[i]);
        //    if (i > 8) {
        //
        //    }
        //}

        return result.toString();
    }

}
